1,606 research outputs found

    Functions as types or the "Hoare logic" of functional dependencies

    Get PDF
    Inspired by the trend on unifying theories of programming, this paper shows how the algebraic treatment of standard data dependency theory equips relational data with functional types and an associated type system which is useful for type checking database operations and for query optimization. Such a typed approach to database programming is then shown to be of the same family as other programming logics such as eg. Hoare logic or that of strongest invariant functions which has been used in the analysis of while statements. The prospect of using automated deduction systems such as Prover9 for type-checking and query optimization on top of such an algebraic approach is considered.Fundação para a Ciência e a Tecnologia (FCT

    "Bagatelle in C arranged for VDM SoLo"

    Get PDF
    This paper sketches a reverse engineering discipline which combines formal and semi-formal methods. Central to the former is denotational semantics, expressed in the ISO/IEC 13817-1 standard specification language (VDM-SL). This is strengthened with algebra of pro- gramming, which is applied in “reverse order” so as to reconstruct formal specifications from legacy code. The latter include code slicing, a “shortcut” which trims down the complexity of handling the formal semantics of all program variables at the same time. A key point of the approach is its constructive style. Reverse calculations go as far as absorbing auxiliary variables, introducing mutual recursion (if applicable) and reversing semantic denota- tions into standard generic programming schemata such as cata/paramorphisms. The approach is illustrated for a small piece of code already studied in the code-slicing literature: Kernighan and Richtie’s word count C programming “bagatelle”.FC

    Towards a linear algebra of programming

    Get PDF
    The Algebra of Programming (AoP) is a discipline for programming from specifications using relation algebra. Specification vagueness and nondeterminism are captured by relations. (Final) implemen- tations are functions. Probabilistic functions are half way between relations and functions: they express the propensity, or like- lihood of ambiguous, multiple outputs. This paper puts forward a basis for a Linear Algebra of Programming (LAoP) extending standard AoP towards probabilistic functions. Because of the quantitative essence of these functions, the allegory of binary relations which supports the AoP has to be extended. We show that, if one restricts to discrete probability spaces, categories of matrices provide adequate support for the extension, while preserving the pointfree reasoning style typical of the AoP.Fundação para a Ciência e a Tecnologia (FCT

    Metaphorisms in programming

    Get PDF
    This paper introduces the metaphorism pattern of relational specification and addresses how specification following this pattern can be refined into recursive programs. Metaphorisms express input-output relationships which preserve relevant information while at the same time some intended optimization takes place. Text processing, sorting, representation changers, etc., are examples of metaphorisms. The kind of metaphorism refinement proposed in this paper is a strategy known as change of virtual data structure. It gives sufficient conditions for such implementations to be calculated using relation algebra and illustrates the strategy with the derivation of quicksort as example.The author wishes to thank the anonymous referees for their comments and suggestions. This work is funded by ERDF - European Regional Development Fund through the COMPETE Programme (operational programme for competitiveness) and by National Funds through the FCT - Funda¸c˜ao para a Ciˆencia e a Tecnologia (Portuguese Foundation for Science and Technology) within project FCOMP-01-0124-FEDER-02053

    "Explosive" programming controlled by calculation

    Get PDF
    In the design of a functional library in the area of data-mining several algorithmic patterns have been identified which call for generic programming. Some of these have to do with flattening functions which arise in a particular group of hierarchical systems. In this paper we describe our efforts to make such functionalities generic. We start by a generic induc- tive construction of the intended class of hierarchical types. We conclude by relating the structure of the relevant base-functors with the algebraic structure which is required by the generic flattening functionality, in particular concerning its “deforestation” towards a linearly complex implementation. The instances we provide as examples include the widely known bill of materials “explode” operation.FC

    Typed linear algebra for weighted (probabilistic) automata

    Get PDF
    There is a need for a language able to reconcile the recent upsurge of interest in quantitative methods in the software sciences with logic and set theory that have been used for so many years in capturing the qualitative aspects of the same body of knowledge. Such a lingua franca should be typed, polymorphic, diagrammatic, calculational and easy to blend with traditional notation. This paper puts forward typed linear algebra (LA) as a candidate notation for such a role. Typed LA emerges from regarding matrices as morphisms of suitable categories whereby traditional linear algebra is equipped with a type system. In this paper we show typed LA at work in describing weighted (prob- abilistic) automata. Some attention is paid to the interface between the index-free language of matrix combinators and the corresponding index- wise notation, so as to blend with traditional set theoretic notation.Fundação para a Ciência e a Tecnologia (FCT

    Extended static checking by calculation using the pointfree transform

    Get PDF
    The pointfree transform offers to the predicate calculus what the La- place transform offers to the differential/integral calculus: the possibility of chang- ing the underlying mathematical space so as to enable agile algebraic calculation. This paper addresses the foundations of the transform and its application to a calculational approach to extended static checking (ESC) in the context of ab- stract modeling. In particular, a calculus is given whose rules help in breaking the complexity of the proof obligations involved in static checking arguments. The close connection between such calculus and that of weakest pre-conditions makes it possible to use the latter in ESC proof obligation discharge, where point- free notation is again used, this time to calculate with invariant properties to be maintained. A connection with the “everything is a relation” lemma of Alloy is estab- lished, showing how close to each other the pointfree and Alloy notations are. The main advantage of this connection is that of complementing pen-and-paper pointfree calculations with model checking support wherever validating sizable abstract models.Fundação para a Ciência e a Tecnologia (FCT

    An integrated formal methods tool-chain and its application to verifying a file system model

    Get PDF
    Tool interoperability as a mean to achieve integration is among the main goals of the international Grand Challenge initiative. In the context of the Verifiable file system mini-challenge put forward by Rajeev Joshi and Gerard Holzmann, this paper focuses on the integration of different formal methods and tools in modelling and verifying an abstract file system inspired by the Intel (R) Flash File System Core. We combine high-level manual specification and proofs with current state of the art mechanical verification tools into a tool-chain which involves Alloy, VDM++ and HOL. The use of (pointfree) relation modelling provides the glue which binds these tools together.Mondrian Project funded by the Portuguese NSF under contract PTDC/EIA-CCO/108302/200

    Programming from Galois connection : principles and applications

    Get PDF
    "Technical Report No. TR-IIS-10-009"Problem statements often resort to superlatives such as in eg. “. . . the smallest such number”, “. . . the best approximation”, “. . . the longest such list” which lead to specifications made of two parts: one defining a broad class of solutions (the easy part) and the other requesting the optimal such solution (the hard part). This paper introduces a binary relational combinator which mirrors this linguistic structure and exploits its potential for calculating programs by optimization. This applies in particular to specifications written in the form of Galois connections, in which one of the adjoints delivers the optimal solution being sought. The framework encompasses re-factoring of results previously developed by Bird and de Moor for greedy and dynamic programming, in a way which makes them less technically involved and therefore easier to understand and play with

    Transposing partial components: an exercise on coalgebraic refinement

    Get PDF
    A partial component is a process which fails or dies at some stage, thus exhibiting a finite, more ephemeral behaviour than expected (eg, operating system crash). Partiality --- which is the rule rather than exception in formal modelling --- can be treated mathematically via totalization techniques. In the case of partial functions, totalization involves error values and exceptions. In the context of a coalgebraic approach to component semantics, this paper argues that the behavioural counterpart to such functional techniques should extend behaviour with try-again cycles preventing from component collapse, thus extending totalization or transposition from the algebraic to the coalgebraic context. We show that a refinement relationship holds between original and totalized components which is reasoned about in a coalgebraic approach to component refinement expressed in the pointfree binary relation calculus. As part of the pragmatic aims of this research, we also address the factorization of every such totalized coalgebra into two coalgebraic components --- the original one and an added front-end --- which cooperate in a client-serverstyle.Fundação para a Ciência e a Tecnologia (FCT) - PURe Project under contract POSI/ICHS/44304/2002
    corecore